package com.zh.singletonmode.services.thread;

public class ThreadSingleton {

    private static final ThreadLocal<ThreadSingleton> threadSingleton = new ThreadLocal<ThreadSingleton>(){
      @Override
      protected ThreadSingleton initialValue() {
          return new ThreadSingleton();
      }
    };

    private ThreadSingleton(){}

    public static ThreadSingleton getInstance() {
        return threadSingleton.get();
    }
}
